package com.fly.feishu.domain.service.impl;

import com.fly.feishu.domain.service.EmployeeService;
import com.fly.feishu.domain.service.common.impl.BaseServiceImpl;
import com.fly.feishu.infrastructure.persistent.mapper.EmployeeMapper;
import com.fly.feishu.infrastructure.persistent.po.Employee;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

@Service
public class EmployeeServiceImpl extends BaseServiceImpl<Employee, EmployeeMapper> implements EmployeeService {
    @Override
    public Employee findByUnique(String key) {
        Example example = new Example(Employee.class);
        example.createCriteria()
                .orEqualTo("id", key)
                .orEqualTo("userId", key)
                .orEqualTo("email", key)
                .orEqualTo("name", key)
                .orEqualTo("mobile", key)
                .orEqualTo("employeeNo", key);
        Employee employee = mapper.selectOneByExample(example);
        return employee;
    }

}
